1. Field of the Invention
This invention relates to data storage systems; in particular, the invention relates to synchronization of source and target volumes in a mirrored storage system.
2. Related Art
Snapshots and multiple volumes are frequently used to prevent data loss when a data storage drive fails in a file system. Such snapshots “capture” the contents of the files and directories in a volume at a particular point in time in order to recover earlier versions of a file following an unintended deletion or modification. Such snapshots can also be copied to one or more volumes, which then can be used as a mirror or a collection or mirrors and which can provide a back-up copy of the file system. When used in this way, the mirror can be referred to as a target volume. In general, a target volume is a “read-only” volume that contains a set of data that is equivalent to the set of data on an original source volume. Such target volumes can be written to only by the original source volume.
A target volume may be updated periodically with respect to a source volume by looking to the most recent snapshot that the target and source have in common and using that snapshot as a consistency point (CP). The file blocks in the most recent common snapshot and the file blocks of a new snapshot are compared. The set of differences resulting from this comparison are written to the less up-to-date volume. In this way, both source and target volumes maintain equivalent sets of file blocks.
A source volume may become unavailable due to a failure of the source volume or to a failed connection to the source volume. Under such conditions, it is advantageous to temporarily use the target volume as a source volume by designating it as a “read/write” volume. User I/Os are directed to write to the target volume while the original source volume is unavailable.
One problem with writing to a target volume is that it may cause the target volume to contain data not found in the original source volume. A partial solution to this problem involves transferring data from the target to the source once the source is restored. However this is undesirable because it requires diversion of computational resources and filer overhead.
Accordingly, it would be advantageous to provide an improved technique for quickly and efficiently updating source and target volumes after a target volume has been written to. This is achieved in an embodiment of the invention that addresses the foregoing deficiencies.